import { createStore, createLogger } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

import user from './modules/user'
import cart from './modules/cart'
import cate from './modules/cate'
export default createStore({
  state: {},
  mutations: {},
  actions: {},
  modules: {
    user,
    cart,
    cate
  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store', // 往本地存的键名
      paths: ['user', 'cart'] // 哪个模块数据需要持久化到本地
    }),
    createLogger()
  ]
})
